/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author hancing
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface DpXinwen extends BasicModel<DpXinwen> {
  title?: string; // 标题
  xwtype?: string; // 文章类型
  smallpic?: string; // 缩略图
  h5url?: string; // 外部URL
  wzcontent?: string; // 内容
}

export const dpXinwenList = (params?: DpXinwen | any) =>
  defHttp.get<DpXinwen>({ url: adminPath + '/dp/xinwen/dpXinwen/list', params });

export const dpXinwenListData = (params?: DpXinwen | any) =>
  defHttp.post<Page<DpXinwen>>({ url: adminPath + '/dp/xinwen/dpXinwen/listData', params });

export const dpXinwenForm = (params?: DpXinwen | any) =>
  defHttp.get<DpXinwen>({ url: adminPath + '/dp/xinwen/dpXinwen/form', params });

export const dpXinwenSave = (params?: any, data?: DpXinwen | any) =>
  defHttp.postJson<DpXinwen>({ url: adminPath + '/dp/xinwen/dpXinwen/save', params, data });

export const dpXinwenDelete = (params?: DpXinwen | any) =>
  defHttp.get<DpXinwen>({ url: adminPath + '/dp/xinwen/dpXinwen/delete', params });
